﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Nihongo
{
    public class WordList : List<Word>
    {
        public bool Contains(string word)
        {
            if (Find(x => x.ToString() == word) != null)
            {
                return true;
            }

            return false;
        }

        public void Add(string word, string kana)
        {
            Add(new Word(word, kana));
        }

        public new void Add(Word item)
        {
            if (Contains(item))
            {
                throw new DuplicateWordException();
            }

            base.Add(item);
        }
    }
}
